package cn.lls.base.result;

import lombok.Getter;

/**
 * 统一返回结果状态信息编码类
 * @ClassName ResultCode
 * @Author 划水艺术家
 * @Date 2022/11/10 0:54
 * @Version 1.0
 **/
@Getter
public enum ResultCode {

    SUCCESS(200,"success"),
    FAIL(500, "fail"),


    PARAM_ERROR( 201, "请求参数与预期不符，缺失或字段指明错误"),
    DATA_ERROR(202, "数据异常，请勿自行传参"),
    EXE_ERROR(203, "操作异常，这是不合理的操作"),

    LOGIN_AUTH(210, "未登录"),
    ACCOUNT_NOT_EXISTS(211, "账号不存在"),
    PWD_FALSE(212, "密码错误"),
    PERMISSION(213, "没有权限执行当前操作"),

    SIGN_ERROR(220, "签名错误"),
    TOKEN_NOT_EXISTS(221, "令牌不存在"),
    TOKEN_EXPIRE(222, "当前令牌已过期"),
    TOKEN_VOID(223, "伪造令牌无效"),

    CODE_ERROR(230, "验证码错误"),
    CODE_SEND_FAIL(231, "验证码发送失败"),
    EMAIL_SEND_FAIL(232, "邮箱发送失败"),

    ILLEGAL_CALLBACK_REQUEST_ERROR( 240, "非法回调请求"),
    DATABASE_ERROR( 241, "数据库异常"),
    EXCEL_EXPORT_ERROR( 242, "excel导出失败"),
    ;

    private final Integer code;
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
